package objects;

import java.util.HashMap;
import java.util.List;

import objects.alignments.Alignment;


public class Subset {
	private Treatment parent;
	private int id;
	private HashMap<Integer, Alignment> alignments;

	public Subset(int id) {
		this.id = id;
		alignments = new HashMap<Integer, Alignment>();
		parent = null;
	}

	public Subset(int id, List<Alignment> alignments, Treatment parent) {
		this.id = id;
		HashMap<Integer, Alignment> temp = new HashMap<Integer, Alignment>();
		for (Alignment a : alignments) {
			temp.put(a.getStart(), a);
		}
		this.alignments = temp;
		this.parent = parent;
	}

	public int getSubsetID() {
		return id;
	}

	public void setTreatmentParent(Treatment t) {
		parent = t;
	}

	public Treatment getTreatmentParent() {
		return parent;
	}

	public void addAlignment(Alignment a) {
		alignments.put(a.getStart(), a);
	}

	public HashMap<Integer, Alignment> getAllAlignments() {
		return alignments;
	}

	public boolean isEmpty() {
		return alignments.isEmpty();
	}
}
